package week01.pay;

/**
 * Created by zhangxiaokun on 2018/1/23.
 */
public class WeixinPayment implements Payable {
    private float value;
    private String message = "微信支付";

    public WeixinPayment(float initMoney) {
        this.value = initMoney;
    }

    @Override
    public float getTotalMoney() {
        return value;
    }

    public void setTotalMoney(float newValue) {
        value = newValue;
    }
    @Override
    public boolean addMoney(float deposit) {
        value += deposit;
        return true;
    }

    @Override
    public boolean subtractMoney(float debit) {
        if (debit > value) {
            System.out.println(message+"钱不够000...");
            return false;
        }
        value -= debit;
        return true;
    }
}

